import java.lang.reflect.*;
public class ReflectTest{
	public static void main(String[] args) throws Exception{
		Class<?> classType = ReflectTest.class;
		Object invokeTester = classType.newInstance();
		Method addMethod = classType.getMethod("add", new Class[]{int.class, int.class});
		Object result = addMethod.invoke(invokeTester, new Object[]{1, 2});
		System.out.println((Integer)result);
		
		Method echoMethod = classType.getMethod("echo", new Class[]{String.class});
		result = echoMethod.invoke(invokeTester, new Object[]{"Tom"});
		System.out.println((String)result);
		
		
	}
	public int add(int para1, int para2){
		return para1 + para2;
	}
	public String echo(String message){
		return "hello" + message;
	}
}